function detectOlderBrowsers() {
    if (!Modernizr.borderradius || !Modernizr.localstorage || !Modernizr.video || !Modernizr.boxshadow || ($.browser.mozilla && parseInt($.browser.version, 10) < 2)) {

        $("#divOlderBrowser").show('slide');
    }
}

function highlightCode()
{
	$("code").each(function(idx)
	{
		var code = $(this).text();

		code = replaceKeywords(code);

		$(this).html(code
		  .replace(/\r/g, '') // get rid of carriage returns
		  .replace(/\n\n/g, '\n&nbsp;\n')
		  .replace(/\n/g, '<br />')
 		  .replace(/\t/g, '&nbsp;')
		);
	});
}

function replaceKeywords(code)
{
	code = code.replace("int", "<span class=\"keyword\">int</span>");
	code = code.replace("void", "<span class=\"keyword\">void</span>");
	code = code.replace("float", "<span class=\"keyword\">float</span>");
	code = code.replace("double", "<span class=\"keyword\">double</span>");
	code = code.replace("string", "<span class=\"keyword\">string</span>");
	code = code.replace("function", "<span class=\"keyword\">function</span>");
	code = code.replace("return", "<span class=\"keyword\">return</span>");
	code = code.replace("switch", "<span class=\"keyword\">switch</span>");
	code = code.replace("case", "<span class=\"keyword\">case</span>");
	code = code.replace("if", "<span class=\"keyword\">if</span>");
	code = code.replace("default", "<span class=\"keyword\">default</span>");
	
	return code;
}